/*
* 与用户相关的请求
* */
import request from '@/utils/request'
const api_group = 'api' //网关前缀
const api_name = 'api-member' //服务名称
export default{
  /*
  * 用户登录
  * */
  login(user) {
    return request({
      url: `/${api_group}/${api_name}/member/login`,
      method: 'post',
      data:user
    })
  },
  //获取登录图片验证码
  getLoginCaptcha(){
    return request({
      url: `/${api_group}/${api_name}/login/captcha`,
      method: 'get',
    })
  },
  //获取注册图片验证码
  getRegisterCaptcha(){
    return request({
      url: `/${api_group}/${api_name}/login/captcha`,
      method: 'get',
    })
  },
  //校验登录验证码
  checkLoginCode(userCode){
    return request({
      url: `/${api_group}/${api_name}/member/check/captcha`,
      method: 'post',
      data:userCode
    })
  },
  //用户注册
  register(user) {
    return request({
      url: `/${api_group}/${api_name}/member/register`,
      method: 'post',
      data:user
    })
  },
}
